// ----------------------------------
// RSDK Project: Sonic Essence
// Script Description: [Object Name]
// Script Author: [YOU]
// ----------------------------------

//-------Aliases-------//

//-------Function declarations-------//

//-------Static Values-------//
private alias object.animationSpeed	 :	player.animationSpeed
private alias object.animationTimer	 :	player.animationTimer

//-------Tables-------//


//-------Functions-------//

function TitlePlayer_AniDraw
	player.animationSpeed ++
		if player.animationSpeed > 3
			object.frame ++
			if object.frame > 7
				object.frame = 0
			endif
			player.animationSpeed = 0
		endif
end function

event ObjectMain
end event

event ObjectDraw
	callFunction(TitlePlayer_AniDraw)
	DrawObjectAnimation()
	object.animation = ANI_RUNNING
end event

event ObjectStartup
	object.priority = PRIORITY_ACTIVE_PAUSED
    	LoadAnimation("Sonic.ani")
	foreach (TypeName[Title Player], arrayPos0, ALL_ENTITIES)
		temp0 = screen.ysize
		temp0 += 64
		//object[arrayPos0].iypos = temp0	//moves sonic out of the screen
	next
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 223, 172)
end event